/*package fy.hr.dao;

import java.util.Iterator;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.json.JSONObject;

import com.dayee.wintalent.service.v8.ExternalResumeService;
import com.dayee.wintalent.service.v8.ExternalResumeServicePortType;

import fy.hr.bean.RecruitmentBean;

public class RecruitmentPersonInfoDao {
	private String idnums;
	private static Log log = LogFactory.getLog(RecruitmentPersonInfoDao.class);
	 RecruitmentBean rb = new RecruitmentBean();
	public JSONObject idnumfindPersonInfo(String idnum) throws Exception {
	//public JSONObject idnumfindPersonInfo() throws Exception {
		try {
			String file = hs.readEntryInformation(
					"<?xml version='1.0' encoding='UTF-8'?>" + "<Condition><corpCode><![CDATA[fuyaogroup]]>"
							+ "</corpCode><userName><![CDATA[fuyaogroup]]></userName>"
							+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>"
							+ "<currentPage><![CDATA[1]]></currentPage><rowSize>"
							+ "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>"
							+ "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>"
							+ "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>"
							+ "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>" 
							+ "</Condition>");
			 ExternalResumeService mywebService = new ExternalResumeService();
			 ExternalResumeServicePortType hs = mywebService.getExternalResumeServiceHttpPort();
			//String idnum="350521199002289763";
			 String file =hs.readEntryInformation("<?xml version='1.0' encoding='UTF-8'?>" + "<Condition><corpCode><![CDATA[fuyaogroup]]>"
						+ "</corpCode><userName><![CDATA[fuyaogroup]]></userName>"
						+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>"
						+ "<currentPage><![CDATA[1]]></currentPage><rowSize>"
						+ "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>"
						+ "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>"
						+ "<vType><![CDATA[1]]></vType>" + "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>"
						+ "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>" + "<idNum>"
						+ idnum + "</idNum>" 
						+ "</Condition>");
			System.out.println("**************?" + file);
			rb.setIdnum(idnum);
			Document document =DocumentHelper.parseText(file);
			 SAXReader reader = new SAXReader();
			//  Document document = reader.read(file);
		    Element root = document.getRootElement();  
		    System.out.println("1"+root.getName());
		    List<Element> secondList =  root.elements();
            for(Element secondElement : secondList){
            	  System.out.println(" \t二级节点名称:"+secondElement.getName()); 
            	  //取得所有的二级子节点的属性
               System.out.println(" \t属性title:"+secondElement.attributeValue("applyId"));
                  List<Element> thirdList =  secondElement.elements();
                  readThirdLevelElement(thirdList);
             }
           
		      @SuppressWarnings("unchecked")
			List<Element> secondList=  root.elements();
            readsecondLevelElement(secondList);
     
		     //使用SAX方式解析xml
            SAXReader saxReader = new SAXReader();
            //把xml文件转换成文档对象
             Document document = saxReader.read(file);
             //取得根节点
             Element rootNode = document.getRootElement();
            //取得根节点的名字
             System.out.println("根节点名称: "+rootNode.getName());
            //取得所有的二级(下一级)子节点
             List<Element> secondList =  rootNode.elements();
            for(Element secondElement : secondList){
            	  System.out.println(" \t二级节点名称:"+secondElement.getName()); 
             }
            
		    //Element  child = null ;
		    List<Element> childElements = root.elements();
		    for (Element child : childElements) {
		    System.out.println("2"+ child.attribute("SchoolName"));
		    }
		    Iterator it = root.elementIterator();
		    while (it.hasNext()) {
		     Element element = (Element) it.next();
		   //  System.out.println("id: " + element.attributeValue("Resume"));}
		   
		  //  Element root = document.addElement("ResumeList");
		  //  listNodes(node); 
		// Element element = node.element("ResumeList"); 
		    
		   
		 
	
		        
		      //遍历当前节点下的所有节点  
		      
		  //获取element的id属性节点对象  
		    //      Attribute attr = element.attribute("id");  
		  //获取element中的作者元素节点对象  
		        
		        
		     Element author = element.element("Ypgw"); 
		     System.out.println(author);

		   
		       
		

			//Document doc = DocumentHelper.parseText(file);
			<?xml version='1.0' encoding='UTF-8'?>" + "<Condition><corpCode><![CDATA[fuyaogroup]]>"
			+ "</corpCode><userName><![CDATA[fuyaogroup]]></userName>"
			+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>"
			+ "<currentPage><![CDATA[1]]></currentPage><rowSize>"
			+ "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>"
			+ "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>"
			+ "<vType><![CDATA[1]]></vType>" + "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>"
			+ "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>" + "<idNum>"
			+ idnum + "</idNum>" + "</Condition>
			// 下面会使用到
		String file2 = file.substring(file.indexOf("EducationBackground", 3),
				file.indexOf("</EducationBackground>"));
			System.out.println(file.substring(file.indexOf("<Ypgw>") + 15, file.indexOf("</Ypgw>") - 3));
			System.out.println(file.substring(file.indexOf("<Name>") + 15, file.indexOf("</Name>") - 3));
			System.out.println(file.substring(file.indexOf("<Gender>") + 17, file.indexOf("</Gender>") - 3));
	System.out.println(file.substring(file.indexOf("<Age>") + 14, file.indexOf("</Age>") - 3));
			System.out.println(file.substring(file.indexOf("<Hometown>") + 19, file.indexOf("</Hometown>") - 3));
			System.out.println(file.substring(file.indexOf("<SchoolName>") + 21, file.indexOf("</SchoolName>") - 3));
			System.out.println(file.substring(file.indexOf("<Diploma>") + 18, file.indexOf("</Diploma>") - 3));
			System.out.println(file.substring(file.indexOf("<WorkYear>") + 19, file.indexOf("</WorkYear>") - 3));
			System.out.println(
					file.substring(file.indexOf("<CurrentCompany>") + 25, file.indexOf("</CurrentCompany>") - 3));
			System.out.println(file.substring(file.indexOf("<ChannelName>") + 22, file.indexOf("</ChannelName>") - 3));
			System.out.println(
					file.substring(file.indexOf("<ExpectedSalary>") + 25, file.indexOf("</ExpectedSalary>") - 3));
		//	System.out.println(file2.substring(file2.indexOf("<Major>") + 16, file2.indexOf("</Major>") - 3));
			System.out.println(
					file.substring(file.indexOf("<CurrentPosition>") + 26, file.indexOf("</CurrentPosition>") - 3));
			System.out.println(file.substring(file.indexOf("<RecruitmentChannels>") + 30,
					file.indexOf("</RecruitmentChannels>") - 3));
			System.out.println(file.substring(file.indexOf("<WorkPlace>") + 20, file.indexOf("</WorkPlace>") - 3));
			System.out
					.println(file.substring(file.indexOf("<MonthlyBonus>") + 23, file.indexOf("</MonthlyBonus>") - 3));
			System.out.println(file.substring(file.indexOf("<Basic>") + 16, file.indexOf("</Basic>") - 3));
			System.out.println(
					file.substring(file.indexOf("<MealAllowance>") + 24, file.indexOf("</MealAllowance>") - 3));
			System.out.println(file.substring(file.indexOf("<TransportationSubsidy>") + 32,
					file.indexOf("</TransportationSubsidy>") - 3));
			System.out.println(
					file.substring(file.indexOf("<CellPhoneSubsidy>") + 27, file.indexOf("</CellPhoneSubsidy>") - 3));
			System.out.println(
					file.substring(file.indexOf("<HousingSubsidies>") + 27, file.indexOf("</HousingSubsidies>") - 3));
			System.out.println(
					file.substring(file.indexOf("<OtherSubsidies>") + 25, file.indexOf("</OtherSubsidies>") - 3));
			System.out.println(file.substring(file.indexOf("<ComprehensiveMonthlyIncome>") + 37,
					file.indexOf("</ComprehensiveMonthlyIncome>") - 3));
			System.out
					.println(file.substring(file.indexOf("<YearEndBonus>") + 23, file.indexOf("</YearEndBonus>") - 3));
			System.out.println(file.substring(file.indexOf("<Welfare>") + 18, file.indexOf("</Welfare>") - 3));
			System.out.println(
					file.substring(file.indexOf("<OtherBenefits>") + 24, file.indexOf("</OtherBenefits>") - 3));
			System.out.println(
					file.substring(file.indexOf("<AnnualCashIncome>") + 27, file.indexOf("</AnnualCashIncome>") - 3));

			JSONObject jo = new JSONObject();
			if (idnum == null) {
				System.out.println("idnum is null");
			} else {
				System.out.println("1%%%%%%%%%%%");
				RecruitmentBean rb = new RecruitmentBean();
				rb.setIdnum(idnum);
				rb.setName(file.substring(file.indexOf("<Name>") + 15, file.indexOf("</Name>") - 3));
				rb.setGender(file.substring(file.indexOf("<Gender>") + 17, file.indexOf("</Gender>") - 3));
				rb.setAge(file.substring(file.indexOf("<Age>") + 14, file.indexOf("</Age>") - 3));
				rb.setHometown(file.substring(file.indexOf("<Hometown>") + 19, file.indexOf("</Hometown>") - 3));
				rb.setShoolName(file.substring(file.indexOf("<SchoolName>") + 21, file.indexOf("</SchoolName>") - 3));
				rb.setCliploma(file.substring(file.indexOf("<Diploma>") + 18, file.indexOf("</Diploma>") - 3));
				rb.setWorkYear(file.substring(file.indexOf("<WorkYear>") + 19, file.indexOf("</WorkYear>") - 3));
				rb.setCurrentCompany(
						file.substring(file.indexOf("<CurrentCompany>") + 25, file.indexOf("</CurrentCompany>") - 3));
				rb.setExpectedSalary(
						file.substring(file.indexOf("<ExpectedSalary>") + 25, file.indexOf("</ExpectedSalary>") - 3));
				rb.setCurrentPosition(
						file.substring(file.indexOf("<CurrentPosition>") + 26, file.indexOf("</CurrentPosition>") - 3));
				rb.setRecruitmentChannels(file.substring(file.indexOf("<RecruitmentChannels>") + 30,
						file.indexOf("</RecruitmentChannels>") - 3));
				rb.setWorkPlace(file.substring(file.indexOf("<WorkPlace>") + 20, file.indexOf("</WorkPlace>") - 3));
			//	rb.setMajor(file2.substring(file2.indexOf("<Major>") + 16, file2.indexOf("</Major>") - 3));
				rb.setBasic(file.substring(file.indexOf("<Basic>") + 16, file.indexOf("</Basic>") - 3));
				rb.setMonthlyBonus(
						file.substring(file.indexOf("<MonthlyBonus>") + 23, file.indexOf("</MonthlyBonus>") - 3));
				rb.setMealAllowance(
						file.substring(file.indexOf("<MealAllowance>") + 24, file.indexOf("</MealAllowance>") - 3));
				rb.setTransportationSubsidy(file.substring(file.indexOf("<TransportationSubsidy>") + 32,
						file.indexOf("</TransportationSubsidy>") - 3));
				rb.setCellPhoneSubsidy(file.substring(file.indexOf("<CellPhoneSubsidy>") + 27,
						file.indexOf("</CellPhoneSubsidy>") - 3));
				rb.setHousingSubsidies(file.substring(file.indexOf("<HousingSubsidies>") + 27,
						file.indexOf("</HousingSubsidies>") - 3));
				rb.setYearEndBonus(
						file.substring(file.indexOf("<YearEndBonus>") + 23, file.indexOf("</YearEndBonus>") - 3));
				rb.setOtherSubsidies(
						file.substring(file.indexOf("<OtherSubsidies>") + 25, file.indexOf("</OtherSubsidies>") - 3));
				rb.setComprehensiveMonthlyIncome(file.substring(file.indexOf("<ComprehensiveMonthlyIncome>") + 37,
						file.indexOf("</ComprehensiveMonthlyIncome>") - 3));
				rb.setAnnualCashIncome(file.substring(file.indexOf("<AnnualCashIncome>") + 27,
						file.indexOf("</AnnualCashIncome>") - 3));
				rb.setWelfare(file.substring(file.indexOf("<Welfare>") + 18, file.indexOf("</Welfare>") - 3));
				rb.setOtherBenefits(
						file.substring(file.indexOf("<OtherBenefits>") + 24, file.indexOf("</OtherBenefits>") - 3));
				jo.put(rb.getID(), rb.getJSONObject());
				System.out.println("2%%%%%%%%%%%");
				return jo;
			}
		} catch (Exception e) {
			log.error("******************************AAAAAAAAAAAAAAAAAAAAAAAAAAAAAa", e);
		}
		return null;

	}
	public boolean statusReturn() throws Exception {
		ExternalResumeService mywebService = new ExternalResumeService();
		ExternalResumeServicePortType hs = mywebService.getExternalResumeServiceHttpPort();
		String status=hs.callbackToChangeStatus(
				   "<?xml version='1.0' encoding='UTF-8'?>"
				   +"<Condition><corpCode><![CDATA[fuyaogroup]]></corpCode>"
					+"<userName><![CDATA[fuyaogroup]]></userName>"
					+"<password><![CDATA[U48w3TAD9PphCcTr]]></password>"
					+"<applyIds><![CDATA[132101]]></applyIds>"
					+"<auditType><![CDATA[4]]></auditType> "
					+"<result><![CDATA[0]]></result> "
					+"<changeType><![CDATA[2]]></changeType> "
				    +"</Condition>");
		return false;
		
	}
	
	// @SuppressWarnings("unchecked")
     public void readThirdLevelElement( List<Element> thirdList){
            for(Element thirdElement : thirdList){
                    System.out.println(" \t\t三级节点名称:"+thirdElement.getName());
                    //取得所有的四级(下一级)子节点
                    List<Element> fourList =  thirdElement.elements();
                    readFourLevelElement(fourList);
             }
     }
	
	//读取四级元素的方法
     public void readFourLevelElement( List<Element> fourList){
    
             for(Element fourElement : fourList){
            	 System.out.println(" \t\t\t四级节点名称:"+fourElement.getName());
            	 //System.out.println("!!!!!!!!"+fourElement.element("PostName").getText());
            	 //if(fourElement.getName().equals("PostName")){
                   //  System.out.println(" \t\t\t     四级节点内容:"+fourElement.getText());

            // }
          	 List<Element> FiveList =  fourElement.elements();
              readFiveLevelElement(FiveList);
           
             }}
           //读取五级元素的方法
             public void readFiveLevelElement( List<Element> FiveList){
            	 String[]a=new String[2];  
                     for(Element fiveElement : FiveList){
                    	 System.out.println(" \t\t\t     五级节点名称:"+fiveElement.getName());
                    	 //System.out.println("!!!!!!!!"+fourElement.element("PostName").getText());
                    	//	System.out.println("11111111"+fiveElement.element("Name").getText()); 
                    	 
                    	 if(fiveElement.getName().equals("Name")){
                             System.out.println(" \t\t\t     五级节点内容++！！！！:"+fiveElement.getText());    
                          int i =0;
                          a[i]=fiveElement.getText();
                          i++;
                         
                    
                 }
               
             	 if(fiveElement.getName().equals("Gender")){
                             System.out.println(" \t\t\t     五级节点内容++！！！！:"+fiveElement.getText());
                     }
                    	 Age
                    	 Hometown
                    	 <SchoolName
                    	 Diploma
                    	 WorkYear
                    	 CurrentCompany
                    	 
                    	 ExpectedSalary
                    	 CurrentPosition
                    	 RecruitmentChannels
                    	 
                    	 WorkPlace
                    	 Major
                    	 
                    	 Basic
                    	 MonthlyBonus
                    	 MealAllowance
                    	 TransportationSubsidy
                    	 CellPhoneSubsidy
                    	 HousingSubsidies
                    	 YearEndBonus
                    	 OtherSubsidies
                    	 ComprehensiveMonthlyIncome
                    	 AnnualCashIncome
                    	 Welfare
                    	 OtherBenefits
             	
                
                    	// System.out.println(" \t\t\t     五级节点内容++！！！！:"+fiveElement.getText());
                     }            
     }
}

package fy.hr.dao;

import java.util.Iterator;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.json.JSONObject;

import com.dayee.wintalent.service.v8.ExternalResumeService;
import com.dayee.wintalent.service.v8.ExternalResumeServicePortType;

import fy.hr.bean.RecruitmentBean;

public class RecruitmentFormDao {
	private String idnums;
	private static Log log = LogFactory.getLog(RecruitmentFormDao.class);

	public JSONObject idnumfindPersonInfo(String idnum) throws Exception {
		System.out.println("222222222222222222222222222222222");
		// public JSONObject idnumfindPersonInfo() throws Exception {
		try {
			
			 * String file = hs.readEntryInformation(
			 * "<?xml version='1.0' encoding='UTF-8'?>" +
			 * "<Condition><corpCode><![CDATA[fuyaogroup]]>" +
			 * "</corpCode><userName><![CDATA[fuyaogroup]]></userName>" +
			 * "<password><![CDATA[U48w3TAD9PphCcTr]]></password>" +
			 * "<currentPage><![CDATA[1]]></currentPage><rowSize>" +
			 * "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>" +
			 * "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>" +
			 * "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>" +
			 * "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>"
			 * + "</Condition>");
			 
			ExternalResumeService mywebService = new ExternalResumeService();
			ExternalResumeServicePortType hs = mywebService.getExternalResumeServiceHttpPort();
			// String num="350521199002289763";
			String file = hs.readEntryInformation(
					"<?xml version='1.0' encoding='UTF-8'?>" + "<Condition><corpCode><![CDATA[fuyaogroup]]>"
							+ "</corpCode><userName><![CDATA[fuyaogroup]]></userName>"
							+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>"
							+ "<currentPage><![CDATA[1]]></currentPage><rowSize>"
							+ "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>"
							+ "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>"
							+ "<vType><![CDATA[1]]></vType>" + "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>"
							+ "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>" + "<idNum>"
							+ idnum + "</idNum>" + "</Condition>");
			System.out.println("**************?" + file);
			Document doc = DocumentHelper.parseText(file);
			Element node = doc.getRootElement();
			Element a_out = node.element("Resume");
			Attribute g = a_out.attribute("applyId");
			String appid = g.getValue();
			System.out.println(appid);

			// 个人信息基本表
			// 姓名

			// String name = ff1.getText();
			// System.out.println(name);
			JSONObject jo = new JSONObject();
			if (idnum == null) {
				System.out.println("idnum is null");
			} else {
				String str = "/ResumeList/Resume/ResumeContent/PersonalInformation/";
				System.out.println("1%%%%%%%%%%%");
				RecruitmentBean rb = new RecruitmentBean();
				rb.setIdnum(idnum);
				Element ff1 = (Element) doc.selectSingleNode(str + "Name");
				rb.setName(ff1.getText());
				Element ff2 = (Element) doc.selectSingleNode(str + "Gender");
				rb.setGender(ff2.getText());
				Element ff3 = (Element) doc.selectSingleNode(str + "Age");
				rb.setAge(ff3.getText());
				Element ff4 = (Element) doc.selectSingleNode(str + "Hometown");
				rb.setHometown(ff4.getText());
				Element ff5 = (Element) doc.selectSingleNode(str + "SchoolName");
				rb.setShoolName(ff5.getText());
				Element ff6 = (Element) doc.selectSingleNode(str + "Diploma");
				rb.setCliploma(ff6.getText());
				Element ff7 = (Element) doc.selectSingleNode(str + "WorkYear");
				rb.setWorkYear(ff7.getText());
				Element ff8 = (Element) doc.selectSingleNode(str + "CurrentCompany");
				rb.setCurrentCompany(ff8.getText());
				Element ff9 = (Element) doc.selectSingleNode(str + "ExpectedSalary");
				rb.setExpectedSalary(ff9.getText());
				Element ff10 = (Element) doc.selectSingleNode(str + "CurrentPosition");
				rb.setCurrentPosition(ff10.getText());
				Element ff11 = (Element) doc.selectSingleNode(str + "RecruitmentChannels");
				rb.setRecruitmentChannels(ff11.getText());
				Element ff12 = (Element) doc.selectSingleNode(str + "WorkPlace");
				rb.setWorkPlace(ff12.getText());
				String str2 = "/ResumeList/Resume/ResumeContent/CurrentSalaryStructure/";
				// rb.setMajor(file2.substring(file2.indexOf("<Major>") + 16,
				// file2.indexOf("</Major>") - 3));
				Element ff13 = (Element) doc.selectSingleNode(str2 + "Basic");
				rb.setBasic(ff13.getText());
				Element ff14 = (Element) doc.selectSingleNode(str2 + "MonthlyBonus");
				rb.setMonthlyBonus(ff14.getText());
				Element ff15 = (Element) doc.selectSingleNode(str2 + "MealAllowance");
				rb.setMealAllowance(ff15.getText());
				Element ff16 = (Element) doc.selectSingleNode(str2 + "TransportationSubsidy");
				rb.setTransportationSubsidy(ff16.getText());
				Element ff17 = (Element) doc.selectSingleNode(str2 + "CellPhoneSubsidy");
				rb.setCellPhoneSubsidy(ff17.getText());
				Element ff18 = (Element) doc.selectSingleNode(str2 + "HousingSubsidies");
				rb.setHousingSubsidies(ff18.getText());
				Element ff19 = (Element) doc.selectSingleNode(str2 + "YearEndBonus");
				rb.setYearEndBonus(ff19.getText());
				Element ff20 = (Element) doc.selectSingleNode(str2 + "OtherSubsidies");
				rb.setOtherSubsidies(ff20.getText());
				Element ff21 = (Element) doc.selectSingleNode(str2 + "ComprehensiveMonthlyIncome");
				rb.setComprehensiveMonthlyIncome(ff21.getText());
				Element ff22 = (Element) doc.selectSingleNode(str2 + "AnnualCashIncome");
				rb.setAnnualCashIncome(ff22.getText());
				Element ff23 = (Element) doc.selectSingleNode(str2 + "Welfare");
				rb.setWelfare(ff23.getText());
				Element ff24 = (Element) doc.selectSingleNode(str2 + "OtherBenefits");
				rb.setOtherBenefits(ff24.getText());
				
				
				jo.put(rb.getID(), rb.getJSONObject());
				System.out.println("2%%%%%%%%%%%");
				return jo;
			}
			
			 * Document document =DocumentHelper.parseText(file);
			 * 
			 * SAXReader reader = new SAXReader(); // Document document =
			 * reader.read(file); Element root = document.getRootElement();
			 * System.out.println("1"+root.getName()); List<Element> secondList
			 * = root.elements(); for(Element secondElement : secondList){
			 * System.out.println(" \t二级节点名称:"+secondElement.getName());
			 * //取得所有的二级子节点的属性
			 * System.out.println(" \t属性title:"+secondElement.attributeValue(
			 * "applyId"));
			 * System.out.println(" \t属性title:"+secondElement.getText());
			 * List<Element> thirdList = secondElement.elements();
			 * readThirdLevelElement(thirdList); }
			 
			
			 * @SuppressWarnings("unchecked") List<Element> secondList=
			 * root.elements(); readsecondLevelElement(secondList);
			 
			// 使用SAX方式解析xml
			
			 * SAXReader saxReader = new SAXReader(); //把xml文件转换成文档对象 Document
			 * document = saxReader.read(file); //取得根节点 Element rootNode =
			 * document.getRootElement(); //取得根节点的名字
			 * System.out.println("根节点名称: "+rootNode.getName());
			 
			// 取得所有的二级(下一级)子节点
			
			 * List<Element> secondList = rootNode.elements(); for(Element
			 * secondElement : secondList){
			 * System.out.println(" \t二级节点名称:"+secondElement.getName()); }
			 

			// Element child = null ;
			
			 * List<Element> childElements = root.elements(); for (Element child
			 * : childElements) { System.out.println("2"+
			 * child.attribute("SchoolName")); }
			 
			
			 * Iterator it = root.elementIterator(); while (it.hasNext()) {
			 * Element element = (Element) it.next(); //
			 * System.out.println("id: " + element.attributeValue("Resume"));}
			 
			// Element root = document.addElement("ResumeList");
			// listNodes(node);
			// Element element = node.element("ResumeList");

			// 遍历当前节点下的所有节点

			// 获取element的id属性节点对象
			// Attribute attr = element.attribute("id");
			
			 * //获取element中的作者元素节点对象
			 * 
			 * 
			 * Element author = element.element("Ypgw");
			 * System.out.println(author);
			 

			// Document doc = DocumentHelper.parseText(file);
			
			 * <?xml version='1.0'
			 * encoding='UTF-8'?>" + "<Condition><corpCode><![CDATA[fuyaogroup]]
			 * >" + "</corpCode><userName><![CDATA[fuyaogroup]]></userName>" +
			 * "<password><![CDATA[U48w3TAD9PphCcTr]]></password>" +
			 * "<currentPage><![CDATA[1]]></currentPage><rowSize>" +
			 * "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>" +
			 * "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>" +
			 * "<vType><![CDATA[1]]></vType>" +
			 * "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>" +
			 * "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>"
			 * + "<idNum>" + idnum + "</idNum>" + "</Condition>
			  // 下面会使用到
			
			 * String file2 = file.substring(file.indexOf("EducationBackground",
			 * 3), file.indexOf("</EducationBackground>"));
			 * System.out.println(file.substring(file.indexOf("<Ypgw>") + 15,
			 * file.indexOf("</Ypgw>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Name>") + 15,
			 * file.indexOf("</Name>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Gender>") + 17,
			 * file.indexOf("</Gender>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Age>") + 14,
			 * file.indexOf("</Age>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Hometown>") +
			 * 19, file.indexOf("</Hometown>") - 3));
			 * System.out.println(file.substring(file.indexOf("<SchoolName>") +
			 * 21, file.indexOf("</SchoolName>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Diploma>") + 18,
			 * file.indexOf("</Diploma>") - 3));
			 * System.out.println(file.substring(file.indexOf("<WorkYear>") +
			 * 19, file.indexOf("</WorkYear>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<CurrentCompany>") + 25,
			 * file.indexOf("</CurrentCompany>") - 3));
			 * System.out.println(file.substring(file.indexOf("<ChannelName>") +
			 * 22, file.indexOf("</ChannelName>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<ExpectedSalary>") + 25,
			 * file.indexOf("</ExpectedSalary>") - 3)); //
			 * System.out.println(file2.substring(file2.indexOf("<Major>") + 16,
			 * file2.indexOf("</Major>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<CurrentPosition>") + 26,
			 * file.indexOf("</CurrentPosition>") - 3));
			 * System.out.println(file.substring(file.indexOf(
			 * "<RecruitmentChannels>") + 30,
			 * file.indexOf("</RecruitmentChannels>") - 3));
			 * System.out.println(file.substring(file.indexOf("<WorkPlace>") +
			 * 20, file.indexOf("</WorkPlace>") - 3)); System.out
			 * .println(file.substring(file.indexOf("<MonthlyBonus>") + 23,
			 * file.indexOf("</MonthlyBonus>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Basic>") + 16,
			 * file.indexOf("</Basic>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<MealAllowance>") + 24,
			 * file.indexOf("</MealAllowance>") - 3));
			 * System.out.println(file.substring(file.indexOf(
			 * "<TransportationSubsidy>") + 32,
			 * file.indexOf("</TransportationSubsidy>") - 3));
			 * System.out.println(
			 * file.substring(file.indexOf("<CellPhoneSubsidy>") + 27,
			 * file.indexOf("</CellPhoneSubsidy>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<HousingSubsidies>") + 27,
			 * file.indexOf("</HousingSubsidies>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<OtherSubsidies>") + 25,
			 * file.indexOf("</OtherSubsidies>") - 3));
			 * System.out.println(file.substring(file.indexOf(
			 * "<ComprehensiveMonthlyIncome>") + 37,
			 * file.indexOf("</ComprehensiveMonthlyIncome>") - 3)); System.out
			 * .println(file.substring(file.indexOf("<YearEndBonus>") + 23,
			 * file.indexOf("</YearEndBonus>") - 3));
			 * System.out.println(file.substring(file.indexOf("<Welfare>") + 18,
			 * file.indexOf("</Welfare>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<OtherBenefits>") + 24,
			 * file.indexOf("</OtherBenefits>") - 3)); System.out.println(
			 * file.substring(file.indexOf("<AnnualCashIncome>") + 27,
			 * file.indexOf("</AnnualCashIncome>") - 3));
			 * 
			 * JSONObject jo = new JSONObject(); if (idnum == null) {
			 * System.out.println("idnum is null"); } else {
			 * System.out.println("1%%%%%%%%%%%"); RecruitmentBean rb = new
			 * RecruitmentBean(); rb.setIdnum(idnum);
			 * rb.setName(file.substring(file.indexOf("<Name>") + 15,
			 * file.indexOf("</Name>") - 3));
			 * rb.setGender(file.substring(file.indexOf("<Gender>") + 17,
			 * file.indexOf("</Gender>") - 3));
			 * rb.setAge(file.substring(file.indexOf("<Age>") + 14,
			 * file.indexOf("</Age>") - 3));
			 * rb.setHometown(file.substring(file.indexOf("<Hometown>") + 19,
			 * file.indexOf("</Hometown>") - 3));
			 * rb.setShoolName(file.substring(file.indexOf("<SchoolName>") + 21,
			 * file.indexOf("</SchoolName>") - 3));
			 * rb.setCliploma(file.substring(file.indexOf("<Diploma>") + 18,
			 * file.indexOf("</Diploma>") - 3));
			 * rb.setWorkYear(file.substring(file.indexOf("<WorkYear>") + 19,
			 * file.indexOf("</WorkYear>") - 3)); rb.setCurrentCompany(
			 * file.substring(file.indexOf("<CurrentCompany>") + 25,
			 * file.indexOf("</CurrentCompany>") - 3)); rb.setExpectedSalary(
			 * file.substring(file.indexOf("<ExpectedSalary>") + 25,
			 * file.indexOf("</ExpectedSalary>") - 3)); rb.setCurrentPosition(
			 * file.substring(file.indexOf("<CurrentPosition>") + 26,
			 * file.indexOf("</CurrentPosition>") - 3));
			 * rb.setRecruitmentChannels(file.substring(file.indexOf(
			 * "<RecruitmentChannels>") + 30,
			 * file.indexOf("</RecruitmentChannels>") - 3));
			 * rb.setWorkPlace(file.substring(file.indexOf("<WorkPlace>") + 20,
			 * file.indexOf("</WorkPlace>") - 3)); //
			 * rb.setMajor(file2.substring(file2.indexOf("<Major>") + 16,
			 * file2.indexOf("</Major>") - 3));
			 * rb.setBasic(file.substring(file.indexOf("<Basic>") + 16,
			 * file.indexOf("</Basic>") - 3)); rb.setMonthlyBonus(
			 * file.substring(file.indexOf("<MonthlyBonus>") + 23,
			 * file.indexOf("</MonthlyBonus>") - 3)); rb.setMealAllowance(
			 * file.substring(file.indexOf("<MealAllowance>") + 24,
			 * file.indexOf("</MealAllowance>") - 3));
			 * rb.setTransportationSubsidy(file.substring(file.indexOf(
			 * "<TransportationSubsidy>") + 32,
			 * file.indexOf("</TransportationSubsidy>") - 3));
			 * rb.setCellPhoneSubsidy(file.substring(file.indexOf(
			 * "<CellPhoneSubsidy>") + 27, file.indexOf("</CellPhoneSubsidy>") -
			 * 3)); rb.setHousingSubsidies(file.substring(file.indexOf(
			 * "<HousingSubsidies>") + 27, file.indexOf("</HousingSubsidies>") -
			 * 3)); rb.setYearEndBonus(
			 * file.substring(file.indexOf("<YearEndBonus>") + 23,
			 * file.indexOf("</YearEndBonus>") - 3)); rb.setOtherSubsidies(
			 * file.substring(file.indexOf("<OtherSubsidies>") + 25,
			 * file.indexOf("</OtherSubsidies>") - 3));
			 * rb.setComprehensiveMonthlyIncome(file.substring(file.indexOf(
			 * "<ComprehensiveMonthlyIncome>") + 37,
			 * file.indexOf("</ComprehensiveMonthlyIncome>") - 3));
			 * rb.setAnnualCashIncome(file.substring(file.indexOf(
			 * "<AnnualCashIncome>") + 27, file.indexOf("</AnnualCashIncome>") -
			 * 3)); rb.setWelfare(file.substring(file.indexOf("<Welfare>") + 18,
			 * file.indexOf("</Welfare>") - 3)); rb.setOtherBenefits(
			 * file.substring(file.indexOf("<OtherBenefits>") + 24,
			 * file.indexOf("</OtherBenefits>") - 3)); jo.put(rb.getID(),
			 * rb.getJSONObject()); System.out.println("2%%%%%%%%%%%"); return
			 * jo; }
			 
		} catch (Exception e) {
			log.error("******************************AAAAAAAAAAAAAAAAAAAAAAAAAAAAAa", e);
		}
		return null;

	}
	
	 * public boolean statusReturn() throws Exception { ExternalResumeService
	 * mywebService = new ExternalResumeService(); ExternalResumeServicePortType
	 * hs = mywebService.getExternalResumeServiceHttpPort(); String
	 * status=hs.callbackToChangeStatus(
	 * "<?xml version='1.0' encoding='UTF-8'?>"
	 * +"<Condition><corpCode><![CDATA[fuyaogroup]]></corpCode>"
	 * +"<userName><![CDATA[fuyaogroup]]></userName>"
	 * +"<password><![CDATA[U48w3TAD9PphCcTr]]></password>"
	 * +"<applyIds><![CDATA[132101]]></applyIds>"
	 * +"<auditType><![CDATA[4]]></auditType> "
	 * +"<result><![CDATA[0]]></result> "
	 * +"<changeType><![CDATA[2]]></changeType> " +"</Condition>"); return
	 * false;
	 * 
	 * }
	 

	
	 * @SuppressWarnings("unchecked") public void readThirdLevelElement(
	 * List<Element> thirdList){ for(Element thirdElement : thirdList){
	 * System.out.println(" \t\t三级节点名称:"+thirdElement.getName());
	 * //取得所有的四级(下一级)子节点 List<Element> fourList = thirdElement.elements();
	 * readFourLevelElement(fourList); } } //读取四级元素的方法 public void
	 * readFourLevelElement( List<Element> fourList){ for(Element fourElement :
	 * fourList){ System.out.println(" \t\t\t四级节点名称:"+fourElement.getName());
	 * //System.out.println("!!!!!!!!"+fourElement.element("PostName").getText()
	 * ); if(fourElement.getName().equals("PostName")){
	 * System.out.println(" \t\t\t     四级节点内容:"+fourElement.getText()); } } }
	 
}
*/
package fy.hr.dao;

import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.json.JSONObject;

import com.dayee.wintalent.service.v8.ExternalResumeService;
import com.dayee.wintalent.service.v8.ExternalResumeServicePortType;

import fy.hr.bean.RecruitmentBean;

public class RecruitmentFormDao {
	private String appid;
	private String idnums;
	ExternalResumeService mywebService = new ExternalResumeService();
	ExternalResumeServicePortType hs = mywebService.getExternalResumeServiceHttpPort();
	private String applyid;
	private static Log log = LogFactory.getLog(RecruitmentFormDao.class);
	private RecruitmentBean recruitmentBean;

	

	private String hrcontroller;
	

	private String  usercontroller;
	private String array[] = new String[10];
	// private List<String> list = new ArrayList<String>();
	private List<String> list1 = new ArrayList<String>();
	private List<String> list2 = new ArrayList<String>();
	private List<String> list3 = new ArrayList<String>();
	private List<String> list4 = new ArrayList<String>();
	private List<String> list5 = new ArrayList<String>();
	private List<String> list6 = new ArrayList<String>();
	private List<String> list7 = new ArrayList<String>();
	private List<String> list8 = new ArrayList<String>();
	private List<String> list9 = new ArrayList<String>();
	private List<String> list10 = new ArrayList<String>();
	private List<String> list11 = new ArrayList<String>();
	private List<String> list12 = new ArrayList<String>();
	private List<String> list13 = new ArrayList<String>();
	private List<String> list14 = new ArrayList<String>();
	private List<String> list15 = new ArrayList<String>();
	private List<String> list16 = new ArrayList<String>();
	private List<String> list17 = new ArrayList<String>();
	private List<String> list18 = new ArrayList<String>();
	private List<String> list19 = new ArrayList<String>();
	private List<String> list20 = new ArrayList<String>();
	private List<String> list21 = new ArrayList<String>();
	private List<String> list22 = new ArrayList<String>();
	private List<String> list23 = new ArrayList<String>();
	private List<String> list24 = new ArrayList<String>();
	private List<String> list25 = new ArrayList<String>();

	@SuppressWarnings("rawtypes")
	public JSONObject idnumfindPersonInfo(String idnum) throws Exception {
		try {
			String file = hs.readEntryInformation("<?xml version='1.0' encoding='UTF-8'?>"
					+ "<Condition><corpCode><![CDATA[fuyaogroup]]></corpCode>"
					+ "<userName><![CDATA[fuyaogroup]]></userName>"
					+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>" + "<currentPage><![CDATA[10]]></currentPage>"
					+ "<rowSize><![CDATA[1]]></rowSize><applyStatus><![CDATA[18]]></applyStatus>"
					+ "<cType><![CDATA[1,4]]></cType>" + "<auditType><vType><![CDATA[1]]></vType>"
					+ "<![CDATA[4]]></auditType>" + "<auditStatus><![CDATA[2]]></auditStatus>"
					+ "<originResumeAttachment><![CDATA[0]]></originResumeAttachment>" /*+ "<idNum>" + idnum + "</idNum>"*/
					+ "</Condition>");
			System.out.println("**************?" + file);
			SAXReader reader = new SAXReader();
			org.dom4j.Document doc = reader.read(new ByteArrayInputStream(file.getBytes("UTF-8")));
			org.dom4j.Element root = doc.getRootElement();
			Element a_out = root.element("Resume");
			Attribute g = a_out.attribute("applyId");
			applyid = g.getValue();
			System.out.println(applyid);
			org.dom4j.Element element;
			org.dom4j.Element element2;
			org.dom4j.Element element3;
			org.dom4j.Element element4;
			JSONObject jo = new JSONObject();
			if (idnum == null) {
				System.out.println("idnum is null");
			} else {

				// "/ResumeList/Resume/ResumeContent/PersonalInformation/";
				RecruitmentBean rb = new RecruitmentBean();
				rb.setIdnum(idnum);
				for (Iterator i = root.elementIterator("Resume"); i.hasNext();) {
					element = (org.dom4j.Element) i.next();
					for (Iterator j = element.elementIterator("ResumeContent"); j.hasNext();) {
						element2 = (org.dom4j.Element) j.next();
						/*
						 * //
						 * "/ResumeList/Resume/ResumeContent/EducationBackground/Major")
						 * for (Iterator z =
						 * element2.elementIterator("EducationBackground");
						 * z.hasNext();) { element3 = (org.dom4j.Element)
						 * z.next(); for (Iterator k2 =
						 * element3.elementIterator("Major"); k2.hasNext();) {
						 * element4 = (org.dom4j.Element) k2.next();
						 * System.out.println("111111qqqq"+element4.elementText(
						 * "Major")); }
						 * 
						 * }
						 */

						for (Iterator k = element2.elementIterator("PersonalInformation"); k.hasNext();) {
							element3 = (org.dom4j.Element) k.next();
						/*	System.out.println(element3.elementText("Name"));
							System.out.println(element3.elementText("Gender"));
							System.out.println(element3.elementText("Age"));
							System.out.println(element3.elementText("SchoolName"));
							System.out.println(element3.elementText("Hometown"));
							System.out.println(element3.elementText("Diploma"));
							System.out.println(element3.elementText("WorkYear"));
							System.out.println(element3.elementText("CurrentCompany"));
							System.out.println(element3.elementText("ExpectedSalary"));
							System.out.println(element3.elementText("CurrentPosition"));
							System.out.println(element3.elementText("RecruitmentChannels"));
							System.out.println(element3.elementText("WorkPlace"));
							System.out.println(element3.elementText("Major"));*/
							rb.setName(element3.elementText("Name"));
							rb.setGender(element3.elementText("Gender"));
							rb.setAge(element3.elementText("Age"));
							rb.setHometown(element3.elementText("Hometown"));
							rb.setShoolName(element3.elementText("SchoolName"));
							rb.setCliploma(element3.elementText("Diploma"));
							rb.setWorkYear(element3.elementText("WorkYear"));
							rb.setCurrentCompany(element3.elementText("CurrentCompany"));
							rb.setExpectedSalary(element3.elementText("ExpectedSalary"));
							rb.setCurrentPosition(element3.elementText("CurrentPosition"));
							rb.setRecruitmentChannels(element3.elementText("RecruitmentChannels"));
							rb.setWorkPlace(element3.elementText("WorkPlace"));
							rb.setMajor(element3.elementText("Major"));
						}

						for (Iterator k1 = element2.elementIterator("CurrentSalaryStructure"); k1.hasNext();) {
							element3 = (org.dom4j.Element) k1.next();
							/*System.out.println(element3.elementText("Basic"));
							System.out.println(element3.elementText("MonthlyBonus"));
							System.out.println(element3.elementText("MealAllowance"));
							System.out.println(element3.elementText("TransportationSubsidy"));
							System.out.println(element3.elementText("CellPhoneSubsidy"));
							System.out.println(element3.elementText("HousingSubsidies"));
							System.out.println(element3.elementText("YearEndBonus"));
							System.out.println(element3.elementText("OtherSubsidies"));
							System.out.println(element3.elementText("ComprehensiveMonthlyIncome"));
							System.out.println(element3.elementText("AnnualCashIncome"));
							System.out.println(element3.elementText("Welfare"));
							System.out.println(element3.elementText("OtherBenefits"));*/

							rb.setBasic(element3.elementText("Basic"));
							rb.setMonthlyBonus(element3.elementText("MonthlyBonus"));
							rb.setMealAllowance(element3.elementText("MealAllowance"));
							rb.setTransportationSubsidy(element3.elementText("TransportationSubsidy"));
							rb.setCellPhoneSubsidy(element3.elementText("CellPhoneSubsidy"));
							rb.setHousingSubsidies(element3.elementText("HousingSubsidies"));
							rb.setYearEndBonus(element3.elementText("YearEndBonus"));
							rb.setOtherSubsidies(element3.elementText("OtherSubsidies"));
							rb.setComprehensiveMonthlyIncome(element3.elementText("ComprehensiveMonthlyIncome"));
							rb.setAnnualCashIncome(element3.elementText("AnnualCashIncome"));
							rb.setWelfare(element3.elementText("Welfare"));
							rb.setOtherBenefits(element3.elementText("OtherBenefits"));
						}

						// "/ResumeList/Resume/InterviewEvaluation/Interviewer/Items/";
						for (Iterator j2 = element.elementIterator("InterviewEvaluation"); j2.hasNext();) {
							element2 = (org.dom4j.Element) j2.next();
							for (Iterator k2 = element2.elementIterator("Interviewer"); k2.hasNext();) {
								element3 = (org.dom4j.Element) k2.next();
								for (Iterator l2 = element3.elementIterator("Items"); l2.hasNext();) {
									element4 = (org.dom4j.Element) l2.next();
						/*			System.out.println(element4.elementText("Apperance"));
									System.out.println(element4.elementText("Character"));
									System.out.println(element4.elementText("Knowledge"));
									System.out.println(element4.elementText("Responsibility"));
									System.out.println(element4.elementText("Attitude"));
									System.out.println(element4.elementText("CommunicationCollaboration"));
									System.out.println(element4.elementText("Flexibility"));
									System.out.println(element4.elementText("PressureCapacity"));
									System.out.println(element4.elementText("SelfRecognition"));
									System.out.println(element4.elementText("LogicalThinking"));
									System.out.println(element4.elementText("WorkExperience"));*/
									hrcontroller=element4.elementText("Apperance");
									list1.add(element4.elementText("Apperance"));
									list2.add(element4.elementText("Character"));
									list3.add(element4.elementText("Knowledge"));
									list4.add(element4.elementText("Responsibility"));
									list5.add(element4.elementText("Attitude"));
									list6.add(element4.elementText("CommunicationCollaboration"));
									list7.add(element4.elementText("Flexibility"));
									list8.add(element4.elementText("PressureCapacity"));
									list9.add(element4.elementText("SelfRecognition"));
									list10.add(element4.elementText("LogicalThinking"));
									list11.add(element4.elementText("WorkExperience"));
									/*
									 * rb.setApperance(element4.elementText(
									 * "Apperance"));
									 * rb.setCharacter(element4.elementText(
									 * "Character"));
									 * rb.setKnowledge(element4.elementText(
									 * "Knowledge"));
									 * rb.setResponsibility(element4.elementText
									 * ("Responsibility"));
									 * rb.setAttitude(element4.elementText(
									 * "Attitude"));
									 * rb.setCommunicationCollaboration(element4
									 * .elementText("CommunicationCollaboration"
									 * ));
									 * rb.setFlexibility(element4.elementText(
									 * "Flexibility"));
									 * rb.setPressureCapacity(element4.
									 * elementText("PressureCapacity"));
									 * rb.setSelfRecognition(element4.
									 * elementText("SelfRecognition"));
									 * rb.setLogicalThinking(element4.
									 * elementText("LogicalThinking"));
									 * rb.setWorkExperience(element4.elementText
									 * ("WorkExperience"));
									 */

								}
								// "/ResumeList/Resume/InterviewEvaluation/Interviewer/ProfessionalDimensions/";
								for (Iterator l3 = element3.elementIterator("ProfessionalDimensions"); l3.hasNext();) {
									element4 = (org.dom4j.Element) l3.next();
									//System.out.println(element4.elementText("ProfessionalExpertise"));
									// rb.setName(ff1.getText());
									/*System.out.println("~~~~~~~" + element4.elementText("ProfessionalQualifications"));
									System.out.println("!!!!!" + element4.elementText("ProfessionalExperience"));
									System.out.println(element4.elementText("ProfessionalSkills"));
									System.out.println(element4.elementText("DevelopmentPotential"));
									System.out.println(element4.elementText("AdvantageThanInternalCandidates"));*/
									list12.add(element4.elementText("ProfessionalExpertise"));
									list13.add(element4.elementText("ProfessionalQualifications"));
									list14.add(element4.elementText("ProfessionalExperience"));
									list15.add(element4.elementText("ProfessionalSkills"));
									list16.add(element4.elementText("DevelopmentPotential"));
									list17.add(element4.elementText("AdvantageThanInternalCandidates"));
									/*
									 * rb.setProfessionalExpertise(element4.
									 * elementText("ProfessionalExpertise"));
									 * rb.setProfessionalQualifications(
									 * element4.elementText(
									 * "ProfessionalQualifications"));
									 * rb.setProfessionalExperience(element4.
									 * elementText("ProfessionalExperience"));
									 * rb.setProfessionalSkills(element4.
									 * elementText("ProfessionalSkills"));
									 * rb.setDevelopmentPotential(element4.
									 * elementText("DevelopmentPotential"));
									 * rb.setAdvantageThanInternalCandidates(
									 * element4.elementText(
									 * "AdvantageThanInternalCandidates"));
									 */

								}
								// "/ResumeList/Resume/InterviewEvaluation/Interviewer/ItemsBelowAreAppliedToManagersFactoryDirectorsAndHigher/";
								for (Iterator l4 = element3.elementIterator(
										"ItemsBelowAreAppliedToManagersFactoryDirectorsAndHigher"); l4.hasNext();) {
									element4 = (org.dom4j.Element) l4.next();
								//	System.out.println(element4.elementText("ProfessionalExpertise"));
								/*	System.out.println(
											element4.elementText("LeadershipSkillsCooperationWithOtherDeparts"));
									System.out.println(
											element4.elementText("AbilityOnPlanningOrganizingDivisionAndSupervision"));
									System.out.println(element4.elementText("EvelopingTalents"));*/
									list18.add(element4.elementText("LeadershipSkillsCooperationWithOtherDeparts"));
									list19.add(element4.elementText("AbilityOnPlanningOrganizingDivisionAndSupervision"));
									list20.add(element4.elementText("EvelopingTalents"));

									/*
									 * rb.setLSSC(element4.elementText(
									 * "LeadershipSkillsCooperationWithOtherDeparts"
									 * )); rb.setAOPO( element4.elementText(
									 * "AbilityOnPlanningOrganizingDivisionAndSupervision"
									 * )); rb.setEvelopingTalents(element4.
									 * elementText("EvelopingTalents"));
									 */

								}
								for (Iterator l5 = element3.elementIterator("Zonghepingjia"); l5.hasNext();) {
									element4 = (org.dom4j.Element) l5.next();
									System.out.println(element4.elementText("Advantage"));
									System.out.println(element4.elementText("Disadvantage"));
									System.out.println(element4.elementText("ComprehensiveAssessment"));
									list21.add(element4.elementText("Advantage"));
									list22.add(element4.elementText("Disadvantage"));
									list23.add(element4.elementText("ComprehensiveAssessment"));
									/*
									 * rb.setAdvantage(element4.elementText(
									 * "Advantage"));
									 * rb.setDisadvantage(element4.elementText(
									 * "Disadvantage"));
									 * rb.setComprehensiveAssessment(element4.
									 * elementText("ComprehensiveAssessment"));
									 */

								}

							}

						}

						/*
						 * rb.setApperance(element4.elementText("Apperance"));
						 * rb.setCharacter(element4.elementText("Character"));
						 * rb.setKnowledge(element4.elementText("Knowledge"));
						 * rb.setResponsibility(element4.elementText(
						 * "Responsibility"));
						 * rb.setAttitude(element4.elementText("Attitude"));
						 * rb.setCommunicationCollaboration(element4.elementText
						 * ("CommunicationCollaboration"));
						 * rb.setFlexibility(element4.elementText("Flexibility")
						 * ); rb.setPressureCapacity(element4.elementText(
						 * "PressureCapacity"));
						 * rb.setSelfRecognition(element4.elementText(
						 * "SelfRecognition"));
						 * rb.setLogicalThinking(element4.elementText(
						 * "LogicalThinking"));
						 * rb.setWorkExperience(element4.elementText(
						 * "WorkExperience"));
						 */
						/*
						 * *
						 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/ItemsBelowAreAppliedToManagersFactoryDirectorsAndHigher/";
						 * Element ff43 = (Element) doc.selectSingleNode(str5+
						 * "LeadershipSkillsCooperationWithOtherDeparts");
						 * rb.setLSSC(ff43.getText()); Element ff44 = (Element)
						 * doc.selectSingleNode(str5+
						 * "AbilityOnPlanningOrganizingDivisionAndSupervision");
						 * rb.setAOPO(ff44.getText()); Element ff45 = (Element)
						 * doc.selectSingleNode(str5+"EvelopingTalents");
						 * rb.setEvelopingTalents(ff45.getText()); String str6=
						 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/Zonghepingjia/";
						 * Element ff46 = (Element)
						 * doc.selectSingleNode(str6+"Advantage");
						 * rb.setEvelopingTalents(ff46.getText()); Element ff47
						 * = (Element)
						 * doc.selectSingleNode(str6+"Disadvantage");
						 * rb.setEvelopingTalents(ff47.getText()); Element ff48
						 * = (Element)
						 * doc.selectSingleNode(str6+"ComprehensiveAssessment");
						 * rb.setEvelopingTalents(ff48.getText());
						 */
						/*
						 * *
						 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/ProfessionalDimensions/";
						 * Element ff37 = (Element)
						 * doc.selectSingleNode(str4+"ProfessionalExpertise");
						 * rb.setProfessionalExpertise(ff37.getText()); Element
						 * ff38 = (Element) doc.selectSingleNode(str4+
						 * "ProfessionalQualifications");
						 * rb.setProfessionalQualifications(ff38.getText());
						 * Element ff39 = (Element)
						 * doc.selectSingleNode(str4+"ProfessionalExperience");
						 * rb.setProfessionalExperience(ff39.getText()); Element
						 * ff40 = (Element)
						 * doc.selectSingleNode(str4+"ProfessionalSkills");
						 * rb.setProfessionalSkills(ff40.getText()); Element
						 * ff41 = (Element)
						 * doc.selectSingleNode(str4+"DevelopmentPotential");
						 * rb.setDevelopmentPotential(ff41.getText()); Element
						 * ff42 = (Element) doc.selectSingleNode(str4+
						 * "AdvantageThanInternalCandidates");
						 * rb.setAdvantageThanInternalCandidates(ff42.getText())
						 * ; String str5 =
						 */
						// System.out.println(list4.get(1) + list4.get(0));
					}
					rb.setApplyid(applyid);
			System.out.println(list1.size());
	//	if(0<list1.size()&&list1.size()<=1||list1.size()>=2){
			if(0<list1.size()){
				     rb.setApperance(list1.get(0));
						rb.setCharacter(list2.get(0));
						rb.setKnowledge(list3.get(0));
						rb.setResponsibility(list4.get(0));
						rb.setAttitude(list5.get(0));
						rb.setCommunicationCollaboration(list6.get(0));
						rb.setFlexibility(list7.get(0));
						rb.setPressureCapacity(list8.get(0));
						rb.setSelfRecognition(list9.get(0));
						rb.setLogicalThinking(list10.get(0));
						rb.setWorkExperience(list11.get(0));
						rb.setProfessionalExpertise(list12.get(0));
						rb.setProfessionalQualifications(list13.get(0));
						rb.setProfessionalExperience(list14.get(0));
						rb.setProfessionalSkills(list15.get(0));
						rb.setDevelopmentPotential(list16.get(0));
						rb.setAdvantageThanInternalCandidates(list17.get(0));
						rb.setLSSC(list18.get(0));
						rb.setAOPO(list19.get(0));
						rb.setEvelopingTalents(list20.get(0));
						rb.setAdvantage(list21.get(0));
						rb.setDisadvantage(list22.get(0));
						rb.setComprehensiveAssessment(list23.get(0));
				
		if(list1.size()>1){
						rb.setCharacter2(list2.get(1));
						rb.setKnowledge2(list3.get(1));
						rb.setResponsibility2(list4.get(1));
						rb.setAttitude2(list5.get(1));
						rb.setCommunicationCollaboration2(list6.get(1));
						rb.setFlexibility2(list7.get(1));
						rb.setPressureCapacity2(list8.get(1));
						rb.setSelfRecognition2(list9.get(1));
						rb.setLogicalThinking2(list10.get(1));
						rb.setWorkExperience2(list11.get(1));
						rb.setProfessionalExpertise2(list12.get(1));
						rb.setProfessionalQualifications2(list13.get(1));
						rb.setProfessionalExperience2(list14.get(1));
						rb.setProfessionalSkills2(list15.get(1));
						rb.setDevelopmentPotential2(list16.get(1));
						rb.setAdvantageThanInternalCandidates2(list17.get(1));
						rb.setLSSC2(list18.get(1));
						rb.setAOPO2(list19.get(1));
						rb.setEvelopingTalents2(list20.get(1));
						System.out.println("~~~~~~~~~~~"+list4.get(1));
						rb.setAdvantage2(list21.get(1));
						rb.setDisadvantage2(list22.get(1));
						rb.setComprehensiveAssessment2(list23.get(1));
						
		}}
					
					jo.put(rb.getID(), rb.getJSONObject());
				}
			}
			return jo;

			/*
			 * System.out.println("\t\ttp:[" + array[0]+ "]");
			 * System.out.println("\t\ttp:[" + array[1]+ "]");
			 */
			/*
			 * Document doc = DocumentHelper.parseText(file); Element node =
			 * doc.getRootElement(); Element a_out = node.element("Resume");
			 * Attribute g = a_out.attribute("applyId"); applyid = g.getValue();
			 * System.out.println(applyid);
			 * 
			 * // 个人信息基本表 // 姓名
			 * 
			 * // String name = ff1.getText(); // System.out.println(name);
			 * JSONObject jo = new JSONObject(); if (idnum == null) {
			 * System.out.println("idnum is null"); } else {
			 * 
			 * String str =
			 * "/ResumeList/Resume/ResumeContent/PersonalInformation/";
			 * System.out.println("1%%%%%%%%%%%"); RecruitmentBean rb = new
			 * RecruitmentBean(); rb.setIdnum(idnum); Element ff1 = (Element)
			 * doc.selectSingleNode(str + "Name"); rb.setName(ff1.getText());
			 * Element ff2 = (Element) doc.selectSingleNode(str + "Gender");
			 * rb.setGender(ff2.getText()); Element ff3 = (Element)
			 * doc.selectSingleNode(str + "Age"); rb.setAge(ff3.getText());
			 * Element ff4 = (Element) doc.selectSingleNode(str + "Hometown");
			 * rb.setHometown(ff4.getText()); Element ff5 = (Element)
			 * doc.selectSingleNode(str + "SchoolName");
			 * rb.setShoolName(ff5.getText()); Element ff6 = (Element)
			 * doc.selectSingleNode(str + "Diploma");
			 * rb.setCliploma(ff6.getText()); Element ff7 = (Element)
			 * doc.selectSingleNode(str + "WorkYear");
			 * rb.setWorkYear(ff7.getText()); Element ff8 = (Element)
			 * doc.selectSingleNode(str + "CurrentCompany");
			 * rb.setCurrentCompany(ff8.getText()); Element ff9 = (Element)
			 * doc.selectSingleNode(str + "ExpectedSalary");
			 * rb.setExpectedSalary(ff9.getText()); Element ff10 = (Element)
			 * doc.selectSingleNode(str + "CurrentPosition");
			 * rb.setCurrentPosition(ff10.getText()); Element ff11 = (Element)
			 * doc.selectSingleNode(str + "RecruitmentChannels");
			 * rb.setRecruitmentChannels(ff11.getText()); Element ff12 =
			 * (Element) doc.selectSingleNode(str + "WorkPlace");
			 * rb.setWorkPlace(ff12.getText()); String str2 =
			 * "/ResumeList/Resume/ResumeContent/CurrentSalaryStructure/";
			 * Element ff13 = (Element) doc.selectSingleNode(str2 + "Basic");
			 * rb.setBasic(ff13.getText()); Element ff14 = (Element)
			 * doc.selectSingleNode(str2 + "MonthlyBonus");
			 * rb.setMonthlyBonus(ff14.getText()); Element ff15 = (Element)
			 * doc.selectSingleNode(str2 + "MealAllowance");
			 * rb.setMealAllowance(ff15.getText()); Element ff16 = (Element)
			 * doc.selectSingleNode(str2 + "TransportationSubsidy");
			 * rb.setTransportationSubsidy(ff16.getText()); Element ff17 =
			 * (Element) doc.selectSingleNode(str2 + "CellPhoneSubsidy");
			 * rb.setCellPhoneSubsidy(ff17.getText()); Element ff18 = (Element)
			 * doc.selectSingleNode(str2 + "HousingSubsidies");
			 * rb.setHousingSubsidies(ff18.getText()); Element ff19 = (Element)
			 * doc.selectSingleNode(str2 + "YearEndBonus");
			 * rb.setYearEndBonus(ff19.getText()); Element ff20 = (Element)
			 * doc.selectSingleNode(str2 + "OtherSubsidies");
			 * rb.setOtherSubsidies(ff20.getText()); Element ff21 = (Element)
			 * doc.selectSingleNode(str2 + "ComprehensiveMonthlyIncome");
			 * rb.setComprehensiveMonthlyIncome(ff21.getText()); Element ff22 =
			 * (Element) doc.selectSingleNode(str2 + "AnnualCashIncome");
			 * rb.setAnnualCashIncome(ff22.getText()); Element ff23 = (Element)
			 * doc.selectSingleNode(str2 + "Welfare");
			 * rb.setWelfare(ff23.getText()); Element ff24 = (Element)
			 * doc.selectSingleNode(str2 + "OtherBenefits");
			 * rb.setOtherBenefits(ff24.getText()); // 专业 Element ff25 =
			 * (Element) doc .selectSingleNode(
			 * "/ResumeList/Resume/ResumeContent/EducationBackground/Major") ;
			 * String file2 = file.substring(file.indexOf("EducationBackground",
			 * 3), file.indexOf("</EducationBackground>"));
			 * rb.setMajor(ff25.getText()); <PrehirdInfo prehiredId="132101">
			 * <PrehiredContent> <AdditionalInformationOnPreHiredAudit>
			 * <Zpmsg><![CDATA[0/102704/102705/102706]]></Zpmsg>
			 * <Ypgs><![CDATA[上海玻璃]]></Ypgs> <Ypbm><![CDATA[IT]]></Ypbm>
			 * <Ypgw><![CDATA[IT]]></Ypgw>
			 * </AdditionalInformationOnPreHiredAudit> </PrehiredContent>
			 * </PrehirdInfo> String str3=
			 * "/ResumeList/Resume/PrehirdInfo/PrehiredContent/AdditionalInformationOnPreHiredAudit";
			 * Element ff26 = (Element) doc.selectSingleNode(str3);
			 * System.out.println("111"+ff26.getText());
			 * 
			 * System.out.println("*******"+file2);
			 * System.out.println(file2.substring(file2.indexOf( "<Major>"),
			 * file2.indexOf("</Major>")));
			 * 
			 * rb.setApplyid(applyid); String str3 =
			 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/Items/";
			 * Element ff26 = (Element) doc.selectSingleNode(str3+"Apperance");
			 * rb.setApperance(ff26.getText()); Element ff27 = (Element)
			 * doc.selectSingleNode(str3+"Character");
			 * rb.setCharacter(ff27.getText()); Element ff28= (Element)
			 * doc.selectSingleNode(str3+"Knowledge");
			 * rb.setKnowledge(ff28.getText()); Element ff29 = (Element)
			 * doc.selectSingleNode(str3+"Responsibility");
			 * rb.setResponsibility(ff29.getText()); Element ff30 = (Element)
			 * doc.selectSingleNode(str3+"Attitude");
			 * rb.setAttitude(ff30.getText()); Element ff31= (Element)
			 * doc.selectSingleNode(str3+"CommunicationCollaboration");
			 * rb.setCommunicationCollaboration(ff31.getText()); Element ff32 =
			 * (Element) doc.selectSingleNode(str3+"Flexibility");
			 * rb.setFlexibility(ff32.getText()); Element ff33 = (Element)
			 * doc.selectSingleNode(str3+"PressureCapacity");
			 * rb.setPressureCapacity(ff33.getText()); Element ff34 = (Element)
			 * doc.selectSingleNode(str3+"SelfRecognition");
			 * rb.setSelfRecognition(ff34.getText()); Element ff35 = (Element)
			 * doc.selectSingleNode(str3+"LogicalThinking");
			 * rb.setLogicalThinking(ff35.getText()); Element ff36 = (Element)
			 * doc.selectSingleNode(str3+"WorkExperience");
			 * rb.setWorkExperience(ff36.getText()); String str4 =
			 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/ProfessionalDimensions/";
			 * Element ff37 = (Element)
			 * doc.selectSingleNode(str4+"ProfessionalExpertise");
			 * rb.setProfessionalExpertise(ff37.getText()); Element ff38 =
			 * (Element)
			 * doc.selectSingleNode(str4+"ProfessionalQualifications");
			 * rb.setProfessionalQualifications(ff38.getText()); Element ff39 =
			 * (Element) doc.selectSingleNode(str4+"ProfessionalExperience");
			 * rb.setProfessionalExperience(ff39.getText()); Element ff40 =
			 * (Element) doc.selectSingleNode(str4+"ProfessionalSkills");
			 * rb.setProfessionalSkills(ff40.getText()); Element ff41 =
			 * (Element) doc.selectSingleNode(str4+"DevelopmentPotential");
			 * rb.setDevelopmentPotential(ff41.getText()); Element ff42 =
			 * (Element) doc.selectSingleNode(str4+
			 * "AdvantageThanInternalCandidates");
			 * rb.setAdvantageThanInternalCandidates(ff42.getText()); String
			 * str5 =
			 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/ItemsBelowAreAppliedToManagersFactoryDirectorsAndHigher/";
			 * Element ff43 = (Element) doc.selectSingleNode(str5+
			 * "LeadershipSkillsCooperationWithOtherDeparts");
			 * rb.setLSSC(ff43.getText()); Element ff44 = (Element)
			 * doc.selectSingleNode(str5+
			 * "AbilityOnPlanningOrganizingDivisionAndSupervision");
			 * rb.setAOPO(ff44.getText()); Element ff45 = (Element)
			 * doc.selectSingleNode(str5+"EvelopingTalents");
			 * rb.setEvelopingTalents(ff45.getText()); String str6=
			 * "/ResumeList/Resume/InterviewEvaluation/Interviewer/Zonghepingjia/";
			 * Element ff46 = (Element) doc.selectSingleNode(str6+"Advantage");
			 * rb.setEvelopingTalents(ff46.getText()); Element ff47 = (Element)
			 * doc.selectSingleNode(str6+"Disadvantage");
			 * rb.setEvelopingTalents(ff47.getText()); Element ff48 = (Element)
			 * doc.selectSingleNode(str6+"ComprehensiveAssessment");
			 * rb.setEvelopingTalents(ff48.getText());
			 * 
			 * jo.put(rb.getID(), rb.getJSONObject());
			 * System.out.println("2%%%%%%%%%%%"); } return jo;
			 */

		} catch (Exception e) {
			log.error("******************************AAAAAAAAAAAAAAAAAAAAAAAAAAAAAa", e);
		}
		return null;
	}
	/*
	 * } public void setIdnums(String idnums) { this.idnums = idnums; }
	 */

	public boolean statusCallback() {
		String temp = this.recruitmentBean.getIdnum(); // String
														// temp="350521199002289763";
		try {
			if (temp.equals("") || temp == null) {
				System.out.println("idnum is error");
			} else {
				appid = this.recruitmentBean.getApplyid();
				// System.out.println("22222222222" + appid);
				String status = hs.callbackToChangeStatus("<?xml version='1.0' encoding='UTF-8'?>" + "<Condition>"
						+ "<corpCode><![CDATA[fuyaogroup]]></corpCode>" + "<userName><![CDATA[fuyaogroup]]></userName>"
						+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>" + "<cType><![CDATA[1]]></cType> "
						+ "<applyIds>" + appid + "</applyIds>" + "</Condition>");

				System.out.println("1111111111111" + status);

				if (status.equals("00")) {
					System.out.println("statuscallback success");
					callbackToChangeStatus();
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("statuscallback fail");
		}
		return true;
	}

	public boolean callbackToChangeStatus() {
		String temp = this.recruitmentBean.getIdnum();
		// String temp="350521199002289763";
		// String temp="";
		try {
			if (temp.equals("") || temp == null) {
				System.out.println("idnum is error");
			} else {
				// int appid =158705;

				System.out.println("22222222223" + appid);
				String status = hs.callbackToChangeStatus("<?xml version='1.0' encoding='UTF-8'?>" + "<Condition>"
						+ "	<corpCode><![CDATA[fuyaogroup]]></corpCode>"
						+ "	<userName><![CDATA[fuyaogroup]]></userName>"
						+ "<password><![CDATA[U48w3TAD9PphCcTr]]></password>" + "<applyIds>" + appid + "</applyIds>"
						+ "<auditType><![CDATA[4]]></auditType>" + "<result><![CDATA[0]]></result>"
						+ "<changeType><![CDATA[2]]></changeType>" + "</Condition>");
				System.out.println(status);
				if (status.equals("00")) {
					System.out.println("callback success");
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("callback fail");
		}

		return true;
	}
	/*
	 * public String getApplyid(String idnum2) throws Exception { String file =
	 * hs.readEntryInformation( "<?xml version='1.0' encoding='UTF-8'?>" +
	 * "<Condition><corpCode><![CDATA[fuyaogroup]]>" +
	 * "</corpCode><userName><![CDATA[fuyaogroup]]></userName>" +
	 * "<password><![CDATA[U48w3TAD9PphCcTr]]></password>" +
	 * "<currentPage><![CDATA[1]]></currentPage><rowSize>" +
	 * "<![CDATA[10]]></rowSize><applyStatus><![CDATA[18]]>" +
	 * "</applyStatus><cType><![CDATA[2,10]]></cType><auditType>" +
	 * "<vType><![CDATA[1]]></vType>" +
	 * "<![CDATA[4]]></auditType><auditStatus><![CDATA[2]]>" +
	 * "</auditStatus><originResumeAttachment><![CDATA[0]]></originResumeAttachment>"
	 * + "<idNum>" + idnum2 + "</idNum>" + "</Condition>"); Document doc =
	 * DocumentHelper.parseText(file); Element node = doc.getRootElement();
	 * Element a_out = node.element("Resume"); Attribute g =
	 * a_out.attribute("applyId"); String applyid = g.getValue(); return
	 * applyid; }
	 */

	public RecruitmentBean getRecruitmentBean() {
		return recruitmentBean;
	}

	public void setRecruitmentBean(RecruitmentBean recruitmentBean) {
		this.recruitmentBean = recruitmentBean;
	}

}
